import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Test from '@/components/Test'

Vue.use(Router)

export default new Router({
	mode:'history',
    routes: [
        {
            path: '/',
            name: 'HelloWorld',
            component: HelloWorld
        },
        {
        	path: '/test',
            name: 'test',
            component: Test
        }
    ],
    // 滚动的对象
    scrollBehavior(to, from, savedPosition) {
    	console.log(to);
    	console.log(savedPosition);
    	return {
    		x:0,
    		y:300
    	}
    }
})
